import { TabHeightService } from './service/tab-height.service';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import {
  FooterComponent,
  GritItemComponent,
  ImageSliderComponent,
  ScrollableTabComponent,
  VerticalGridComponent,
  ProductCartComponent,
} from './components';
import {
  GridImgDirective,
  GridItemDirective,
  GridTitleDirective,
} from './directive';
import { CountDownComponent } from './components/count-down/count-down.component';
import { CountDownRxComponent } from './components/count-down-rx/count-down-rx.component';
import { TabHeightDirective } from './directive/tab-height/tab-height.directive';
import { DialogModule } from '../dialog/dialong.module';
import { CountComponent } from './components/count/count.component';
import { StoreModule } from '@ngrx/store';
import * as cartReducer from './ngrx/cart-store/cart.reducer';
import { UtilsService } from './service/utils.service';
/**
 * 导入导出公共模块
 */
@NgModule({
  declarations: [
    ScrollableTabComponent,
    ImageSliderComponent,
    GritItemComponent,
    CountDownComponent,
    CountDownRxComponent,
    CountComponent,
    FooterComponent,
    GridItemDirective,
    GridImgDirective,
    GridTitleDirective,
    TabHeightDirective,
    VerticalGridComponent,
    ProductCartComponent,
  ],
  imports: [
    CommonModule,
    FormsModule,
    DialogModule,
    // StoreModule.forRoot({ cart: cartReducer.reducer }),
    StoreModule.forFeature('cart', cartReducer.reducer),
  ],
  providers: [TabHeightService, UtilsService],
  exports: [
    CommonModule,
    FormsModule,
    DialogModule,
    ScrollableTabComponent,
    ImageSliderComponent,
    CountDownComponent,
    CountDownRxComponent,
    CountComponent,
    FooterComponent,
    GridItemDirective,
    GritItemComponent,
    GridImgDirective,
    GridTitleDirective,
    TabHeightDirective,
    VerticalGridComponent,
    ProductCartComponent,
  ],
})
export class SharedModule {}
